package com.qqtech.qquan.user.dao;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Repository;

import com.qqtech.core.frame.dao.BaseDaoImpl;
import com.qqtech.qquan.user.model.UserMessage;
import com.qqtech.qquan.user.model.UserMessageQuery;

@Repository
public class UserMessageDaoImpl extends BaseDaoImpl<UserMessage> implements UserMessageDao {
	public static final Logger log = LoggerFactory.getLogger(UserMessageDaoImpl.class);

	@Override
	public UserMessage queryLastMessage(Integer fromId, Integer toId) {
		UserMessageQuery messageQ = new UserMessageQuery();
		messageQ.setFromId(fromId);
		messageQ.setToId(toId);
		return sqlSessionTemplate.selectOne(getSqlName("selectLastMessage"), messageQ);
	}
	
}
